package com.fwtai.api;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 关注|粉丝
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2021年7月20日 10:42:45
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class ApiConsultDao{

    @Resource
    private DaoHandle dao;

    public int addCollectUser(final HashMap<String,Object> params){
        return dao.execute("api_consult.addCollectUser",params);
    }

    @Transactional
    public int addCollectLawyer(final HashMap<String,Object> params){
        dao.execute("api_consult.updateAskStatus",params);
        return dao.execute("api_consult.addCollectLawyer",params);
    }

    public List<Map<String, Object>> getLawyerList(final PageFormData formData){
        return dao.queryForListMap("api_consult.getLawyerList",formData);
    }

    public List<Map<String, Object>> getUserList(final PageFormData formData){
        return dao.queryForListMap("api_consult.getUserList",formData);
    }

    public List<Map<String, Object>> getUserCollect(final PageFormData formData){
        return dao.queryForListMap("api_consult.getUserCollect",formData);
    }

    public  List<Map<String, Object>> getLawyerCollect(final PageFormData formData){
        return dao.queryForListMap("api_consult.getLawyerCollect",formData);
    }
}